<!DOCTYPE html>
<!--
/*
 * Copyright (C) 2013 rdrrlabs gmail com,
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
-->
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>TimeriGo :: {{.TabName}}</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- Bootstrap styles -->
    <link href="/static/css/bootstrap.min.css" rel="stylesheet">
    <style>
        body {
            padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
        }
    </style>
    <link href="/static/css/bootstrap-responsive.min.css" rel="stylesheet">
    <style>
        /* Overrride bootsrap .brand right padding in the top navbar. */
        .navbar .brand {
            padding-right: 0px !important;
            font-size: 100% !important;
        }

        /* Display footer always at bottom */
        footer {
            position: absolute;
            bottom: 0px;
            width: 100%;
            padding-top: 10px;
            background-color: #f5f5f5;
        }

        footer > p {
            padding: 0px 10px;
        }

        /* Revert 'pull-right' on sign-in div when nav-collapse is in action.
           Otherwise it's obscured by the first nav element. */
        @media (max-width: 980px) {
            .timeri-sign-in {
                float: none;
            }
        }
    </style>

    <!-- jQueryUI -->
    <link href="http://code.jquery.com/ui/1.10.2/themes/cupertino/jquery-ui.css" rel="stylesheet">
    <!-- Data grid -->
    <link href="/static/css/datatable_table.css" rel="stylesheet">
    <link href="/static/css/datatable_pager.css" rel="stylesheet">

  </head>

  <body>

    <div class="navbar navbar-inverse navbar-fixed-top">
        <div class="navbar-inner">
            <div class="container">
                <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <span class="brand" href="#">TimeriGo ::</span>
                <div class="nav-collapse collapse">
                    <p class="navbar-text pull-right timeri-sign-in">
                        {{if .SignLink}}
                            <a href="{{.SignLink}}">Sign In</a>
                        {{else}}
                            {{if .Email}}Welcome <span title="{{.UserTooltip}}">{{.Email}}</span>{{end}}
                            &nbsp;|&nbsp;
                            {{if .LogoutLink}}<a href="{{.LogoutLink}}">{{end}}Log out{{if .LogoutLink}}</a>{{end}}
                        {{end}}
                    </p>
                    <ul class="nav">
                        {{range .Tabs}}
                            <li class="{{.Active}}"><a href="{{.URL}}">{{.Title}}</a></li>
                        {{end}}
                    </ul>
                </div><!--/.nav-collapse -->
            </div>
        </div>
    </div>

    <div class="container">
    {{.TabContent}}
    </div> <!-- /container -->

    <footer class="footer">
      <p class="credit">
        {{.Timestamp}}
        <span id="timeriJSTimestamp"></span>
        <span class="pull-right">
        {{.AppVersion}}
        </span>
      </p>
      <p class="error">
        {{.ErrStr}}
      </p>
    </footer>


<script type="text/javascript">
var timeri_start_time = Date.now();
</script>

    <!-- Bootsrap javascript -->
    <script src="http://code.jquery.com/jquery.js"></script>
    <script src="/static/js/bootstrap.min.js"></script>
    <script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>

    <!-- Data grid -->
    <script src="/static/js/jquery.dataTables.min.js"></script>
    <script src="/static/js/datatables_bootstrap.js"></script>

    {{if .TabPathJS}}
    <script src="/static/js/{{.TabPathJS}}.js" type="text/javascript"></script>
    {{end}}

    <!-- Google analytics -->
    <script type="text/javascript">
      if (document.location.hostname != "localhost") {
          var _gaq = _gaq || [];
          _gaq.push(["_setAccount", "UA-37396631-1"]);
          _gaq.push(["_trackPageview"]);
          (function() {
            var ga = document.createElement("script"); ga.type = "text/javascript"; ga.async = true;
            ga.src = ("https:" == document.location.protocol ? "https://ssl" : "http://www") + ".google-analytics.com/ga.js";
            var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(ga, s);
          })();
       }
    </script>

  </body>
</html>

